#include <stdio.h>
#include <stdlib.h>
#include "bonc.h"
typedef struct node_t
{
	char data;
	struct node_t *lchild;
	struct node_t *rchild;
}tree_t;

void Number(tree_t *T, int *num)
{
	if(T)
	{
        	if(T->lchild == NULL && T->rchild == NULL)
		{
        		*num++;
		}
        else
	{
		Number(T->lchild,num);
		Number(T->rchild,num);
        }
	}
}

int main()
{
	tree_t *T;
	int num = 0;
	tree_t A = {'A', NULL, NULL};
	tree_t B = {'B', NULL, NULL};
	tree_t C = {'C', NULL, NULL};
	tree_t D = {'D', NULL, NULL};
	tree_t E = {'E', NULL, NULL};
	tree_t F = {'F', NULL, NULL};
	A.lchild = &B;
	A.rchild = &C;
	B.lchild = &D;
	B.rchild = &E;
	C.lchild = &F;
	Number(T,&num);
	bonc_print_in("%d",num);
}
